package org.pattern.builder.builders.readers;

import org.pattern.builder.model.PizzaPropertyNames;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 16-11-2010
 * Time: 18:50:46
 * To change this template use File | Settings | File Templates.
 */
public class PizzaTextFileReader extends PizzaFileReader{

    public String getProperty(String property) {

    String line = null; 

    try {
        String filePath = "C:\\My Dropbox\\Div. Java projekter\\GofPatterns\\target\\classes\\org\\pattern\\builder\\builders\\readers\\" + getFilename();
        BufferedReader input =  new BufferedReader(new FileReader(filePath));
      try {
        while (( line = input.readLine()) != null){
            if (line.startsWith(property))
                break; 
        }
      }
      finally {
        input.close();
      }
    }
    catch (Exception ex){
        ex.printStackTrace();
        System.exit(1);

    }

    return line.substring(line.indexOf("==")+2);
    }
}
